package com.zhiyou.app.shop.manager.service;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Order;

import com.zhiyou.app.shop.common.util.Page;
import com.zhiyou.app.shop.manager.dao.pojo.Comment;
import com.zhiyou.app.shop.manager.dao.pojo.Goods;
import com.zhiyou.app.shop.manager.dao.pojo.GoodsImg;
import com.zhiyou.app.shop.manager.dao.pojo.Shop;
import com.zhiyou.app.shop.manager.dao.pojo.ShoppingTrolley;
import com.zhiyou.app.shop.manager.dao.pojo.UserDetail;


public interface IGoodsManageService {
	
	/**************商品管理***********************/
	
	void saveOrUpdateGoods(Goods goods);
	
	void queryGoodsWithPage(Page page, Goods goods, Order order);
	
	void deleteGoods(String ids);
	
	Goods findGoodsById(String id);
	
	List<GoodsImg> findGoodsImgByGoodsId(String goodsId);

	void setSaleState(String ids, boolean onSale);
	
	/**获取商品详情，包括图片和商家信息**/
	Goods findGoodsWithShopUserAndImgs(String id);
	
	/**收藏商品,如果已收藏则不做任何处理**/
	void addMyFavGoods(UserDetail ud, Goods goods);
	/**获取我收藏的商品列表**/
	void findMyFavGoodsByPage(Page page, UserDetail ud, Order order);
	/**添加商品访问日志**/
	void saveGoodsVisitLog(Goods goods, UserDetail ud);
	/**保存商品评论**/
	void saveGoodsComment(Comment comment);
	/**商品评论列表**/
	void findCommentsByGoods(Page page, Goods goods);
	
	/**添加购物车**/
	void saveShoppingTrolley(ShoppingTrolley trolley);
	/**删除购物车中某商品**/
	void deleteShoppingTrolley(String trolleyId);
	/**修改购物车中某商品要购买的数量**/
	void updateShoppingTrolley(String trolleyId, int amount);
	/**购物车列表**/
	List<ShoppingTrolley> findShoppingTrolleyByUser(UserDetail ud);
	
	/**查询商品信息包含图片和分类**/
	Goods findGoodsWithAssociate(String goodsId);
	/**删除一条商品评论**/
	void deleteGoodsComments(String commentId);
}
